<html>
<head>
<title>Docs For Class Pike_View_Helper_Navigation_PikeMenu</title>
<link rel="stylesheet" type="text/css" href="../../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">Pike_View</td>
  </tr>
  <tr><td class="header_line"><img src="../../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                                                                                                                                                                
                              		  [ <a href="../../classtrees_Pike_View.html" class="menu">class tree: Pike_View</a> ]
		  [ <a href="../../elementindex_Pike_View.html" class="menu">index: Pike_View</a> ]
		  	    [ <a href="../../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../../li_Pike.html">Pike</a><br />
              <a href="../../li_DoctrineExtensions-Paginate.html">DoctrineExtensions-Paginate</a><br />
              <a href="../../li_Pike_Application.html">Pike_Application</a><br />
              <a href="../../li_Pike_Doctrine.html">Pike_Doctrine</a><br />
              <a href="../../li_Pike_Grid.html">Pike_Grid</a><br />
              <a href="../../li_Pike_Reflection.html">Pike_Reflection</a><br />
              <a href="../../li_Pike_Session.html">Pike_Session</a><br />
              <a href="../../li_Pike_View.html">Pike_View</a><br />
            <br /><br />
                        <b>Files:</b><br />
      	  <div class="package">
			<a href="../../Pike_View/_View---Stream.php.html">		Stream.php
		</a><br>
	  </div><br />
	subpackage <b>Helper</b><br>  <div class="package">
			<a href="../../Pike_View/Helper/_View---Helper---FlashMessages.php.html">		FlashMessages.php
		</a><br>
			<a href="../../Pike_View/Helper/_View---Helper---FormatException.php.html">		FormatException.php
		</a><br>
			<a href="../../Pike_View/Helper/_View---Helper---Navigation---PikeMenu.php.html">		PikeMenu.php
		</a><br>
	  </div><br />
      
      
            <b>Classes:</b><br />
        <div class="package">
	Helper<br />	    &nbsp;&nbsp;		<a href="../../Pike_View/Helper/Pike_View_Helper_FlashMessages.html">Pike_View_Helper_FlashMessages</a><br />
	    &nbsp;&nbsp;		<a href="../../Pike_View/Helper/Pike_View_Helper_FormatException.html">Pike_View_Helper_FormatException</a><br />
	    &nbsp;&nbsp;		<a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html">Pike_View_Helper_Navigation_PikeMenu</a><br />
	  </div>
  <div class="package">
		    		<a href="../../Pike_View/Pike_View_Stream.html">Pike_View_Stream</a><br />
	  </div>
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Class: Pike_View_Helper_Navigation_PikeMenu</h1>
Source Location: /View/Helper/Navigation/PikeMenu.php<br /><br />


<table width="100%" border="0">
<tr><td valign="top">

<h3><a href="#class_details">Class Overview</a></h3>
<pre>Zend_View_Helper_Navigation_Menu
   |
   --Pike_View_Helper_Navigation_PikeMenu</pre><br />
<div class="description">With PiKe menu you can render a menu with an addidtional permission check. The normal navigation</div><br /><br />
<h4>Author(s):</h4>
<ul>
              </ul>




      
      

<h4>Copyright:</h4>
<ul>
  <li>Copyright (C) 2011 by Pieter Vogelaar (platinadesigns.nl) and Kees Schepers (keesschepers.nl)</li>
</ul>
        
</td>

<td valign="top">
<h3><a href="#class_vars">Variables</a></h3>
<ul>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#var$_roles">$_roles</a></li>
  </ul>
</td>


<td valign="top">
<h3><a href="#class_methods">Methods</a></h3>
<ul>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodaddRole">addRole</a></li>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodgetRoles">getRoles</a></li>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodPikeMenu">PikeMenu</a></li>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodsetRoles">setRoles</a></li>
    <li><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#method_acceptAcl">_acceptAcl</a></li>
  </ul>
</td>

</tr></table>
<hr />

<table width="100%" border="0"><tr>






</tr></table>
<hr />

<a name="class_details"></a>
<h3>Class Details</h3>
<div class="tags">
[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a69">69</a>]<br />
With PiKe menu you can render a menu with an addidtional permission check. The normal navigation<br /><br /><p>menu helper has support for setting only one role with setRole. Some applications users are  allowed to have more roles and when menu is rendered it needs to check the user may see an entry  based on __multiple__ roles! Check it out!</p><p>It work's very simple, in your frontcontroller plugin or bootstrap where you set up  your website navigation replace your current menu implementation by the following:</p><p><ol><li><div class="src-line">&nbsp;<span class="src-var">$config&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">Zend_Config_Xml</span><span class="src-sym">(</span><span class="src-var">$fileToANavigationXML</span><span class="src-sym">,&nbsp;</span><span class="src-str">'nav'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$navigation&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">Zend_Navigation</span><span class="src-sym">(</span><span class="src-var">$config</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$arrayOfroles&nbsp;</span>=&nbsp;<span class="src-id">Zend_Auth</span><span class="src-sym">::</span><span class="src-id">getInstance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">getIdentity</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodgetRoles">getRoles</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$layoutView</span><span class="src-sym">-&gt;</span><span class="src-id">navigation</span><span class="src-sym">(</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodPikeMenu">PikeMenu</a><span class="src-sym">(</span><span class="src-var">$navigation</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">setACL</span><span class="src-sym">(</span><span class="src-id">Zend_Registry</span><span class="src-sym">::</span><span class="src-id">get</span><span class="src-sym">(</span><span class="src-str">'acl'</span><span class="src-sym">))&nbsp;</span><span class="src-comm">//should&nbsp;be&nbsp;a&nbsp;object&nbsp;of&nbsp;type&nbsp;Zend_ACL</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../Pike_View/Helper/Pike_View_Helper_Navigation_PikeMenu.html#methodsetRoles">setRoles</a><span class="src-sym">(</span><span class="src-var">$arrayOfRoles</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></p><p>And make sure u use PikeMenu either in your view (layout script proberly)</p><p>&lt;?= $this-&gt;navigation()-&gt;PikeMenu(); ?&gt;</p><p>Next make sure the Pike library is loaded with autoloaderNamespaces[] = &quot;Pike&quot;  in your  application.ini. And beyond to make sure the view navigation helper is found add something like  the following to it:</p><p>resources.view.helperPath.Pike_View_Helper_Navigation_ =                       APPLICATION_PATH &quot;/../library/Pike/View/Helper/Navigation&quot;</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>copyright:</b>&nbsp;&nbsp;</td><td>Copyright (C) 2011 by Pieter Vogelaar (platinadesigns.nl) and Kees Schepers (keesschepers.nl)</td>
  </tr>
  <tr>
    <td><b>license:</b>&nbsp;&nbsp;</td><td>MIT</td>
  </tr>
</table>
</div>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />

<hr />
<a name="class_vars"></a>
<h3>Class Variables</h3>
<div class="tags">
	<a name="var$_roles"></a>
	<p></p>
	<h4>$_roles = <span class="value">array()</span></h4>
	<p>[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a72">72</a>]</p>
  <br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
</div>

  <br />
	<div class="tags">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><b>Type:</b>&nbsp;&nbsp;</td>
      <td>mixed</td>
    </tr>
      </table>
	</div><br /><br />
	<div class="top">[ <a href="#top">Top</a> ]</div><br />
</div><br />

<hr />
<a name="class_methods"></a>
<h3>Class Methods</h3>
<div class="tags">

  <hr />
	<a name="methodaddRole"></a>
	<h3>method addRole <span class="smalllinenumber">[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a123">123</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void addRole(

$role)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		<br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">&nbsp;&nbsp;</td>
        <td><b>$role</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodgetRoles"></a>
	<h3>method getRoles <span class="smalllinenumber">[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a118">118</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void getRoles(
)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		<br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodPikeMenu"></a>
	<h3>method PikeMenu <span class="smalllinenumber">[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a74">74</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void PikeMenu(
[
$container = null])</code>
    </td></tr></table>
    </td></tr></table><br />
	
		<br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">Zend_Navigation_Container&nbsp;&nbsp;</td>
        <td><b>$container</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="methodsetRoles"></a>
	<h3>method setRoles <span class="smalllinenumber">[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a140">140</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void setRoles(

$roles)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		<br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">array&nbsp;&nbsp;</td>
        <td><b>$roles</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
  <hr />
	<a name="method_acceptAcl"></a>
	<h3>method _acceptAcl <span class="smalllinenumber">[line <a href="../../__filesource/fsource_Pike_View_Helper_ViewHelperNavigationPikeMenu.php.html#a83">83</a>]</span></h3>
	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
		<code>void _acceptAcl(

$page)</code>
    </td></tr></table>
    </td></tr></table><br />
	
		<br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b>access:</b>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
</div>
<br /><br />

	
        <h4>Parameters:</h4>
    <div class="tags">
    <table border="0" cellspacing="0" cellpadding="0">
          <tr>
        <td class="type">Zend_Navigation_Page&nbsp;&nbsp;</td>
        <td><b>$page</b>&nbsp;&nbsp;</td>
        <td></td>
      </tr>
        </table>
    </div><br />
        <div class="top">[ <a href="#top">Top</a> ]</div>
  </div>
</div><br />


        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 15 Sep 2011 16:24:59 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>